package 国庆编程作业;

import java.util.HashSet;
import java.util.Set;

public class Test03 {
    public static void main(String[] args) {
        Set<Student> set = new HashSet<>();

        set.add(new Student(1,"Tom",87));
        set.add(new Student(2,"Lucy",95));
        //当hashCode方法Objects.hash(stuId, name)，发生hash冲突
        set.add(new Student(3,"William",63));
        set.add(new Student(3,"William",65));
        System.out.println("set的内容" + set);

        for(Student s : set){
            System.out.println(s);
        }
    }
}
